package com.object.module.sys.controller;

import com.alibaba.excel.EasyExcel;
import com.object.module.sys.entity.TUserEntity;
import com.object.module.sys.service.TUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@RestController
public class TTetsController {
 @Autowired
 private TUserService userService;


 @GetMapping("/test")
    public void  test(HttpServletResponse response) throws IOException {
     List<TUserEntity> list = userService.list();
     EasyExcel.write(response.getOutputStream(), TUserEntity.class).sheet("用户信息").doWrite(list);
 }

}
